// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   MenuElement.java

package app;

import java.io.IOException;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import ui.Element;

public class MenuEach extends Element
{
    public MenuEach(String url,String menu,String hover, int x, int y)
    {
        super(0, y);
        super.selectable = true;
        super.clickable = true;
        this.url = url;
        this.xaxis = x;
        this.yaxis = y;

        try
        {
            String str = menu;
            img = Image.createImage(str);
            str = hover;
            imghover = Image.createImage(str);
            super.height = img.getHeight();
            super.width = img.getWidth();
        }
        catch(IOException e)
        {
            System.out.println("error Apa : ? " + e.getMessage());
        }
    }

    public void draw(Graphics g, int x, int y, int startY, int stopY, boolean selected)
    {
        //y += super.top;
        System.out.println("X "+x);
        if(selected)
            //g.drawImage(imghover, x, y, Graphics.TOP|Graphics.LEFT);
            g.drawImage(imghover, this.xaxis, this.yaxis, Graphics.TOP|Graphics.LEFT);
        else
            //g.drawImage(img, x, y, Graphics.TOP|Graphics.LEFT);
            g.drawImage(img, this.xaxis, this.yaxis, Graphics.TOP|Graphics.LEFT);
    }

    private int xaxis;
    private int yaxis;
    public String url;
    private Image img;
    private Image imghover;
}
